import java.util.Scanner;
public class Lab07_Task03 {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int i = s.nextInt();
        if (i<0){
            System.out.println("The value of N must be positive!!!");
            System.exit(0);
        }
        int j = 0;
        int k = 0;
        int m = i;
        String out = "";
        int[][] v = new int[i][i];
        while(i>k){
            while (i>j){
                v[k][j] = m*(k+1);
                if (j!=i-1){
                out = out+v[k][j]+"\t";
                } else {
                    out = out+v[k][j];
                }
                m--;
                j++;
            }
            System.out.println(out);
            out = "";
            j=0;
            m=i;
            k++;
        }
    }
}